﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Sharp.Domain.Model;

namespace Sharp.Domain.PlatformBoundedContext.WorkFlowModule.Aggregates
{
    /// <summary>
    /// 日志记录实体
    /// </summary>
    [Table("WorkFlow_Logs")]
    public class LogEntity : IAggregateRoot<int>
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Column(Order = 0)]
        public int Id { get; set; }

        [Required]
        [Column(Order = 1)]
        public int EventTypeID { get; set; }

        [Required]
        [Column(Order = 2)]
        public int Priority { get; set; }

        [Required]
        [Column( Order = 3)]
        [MaxLength(50)]
        public string Severity { get; set; }

        [Required]
        [Column( Order = 4)]
        [MaxLength(256)]
        public string Title { get; set; }

        [Column(Order = 5)]
        [MaxLength(500)]
        public string Message { get; set; }

        [Column(Order = 6)]
        [MaxLength(4000)]
        public string StackTrace { get; set; }

        [Column(Order = 7)]
        [MaxLength(4000)]
        public string InnerStackTrace { get; set; }

        [Column(Order = 8)]
        [MaxLength(2000)]
        public string RequestData { get; set; }

        [Required]
        [Column( Order = 9)]
        public DateTime Timestamp { get; set; }
    }
}
